package cn.ljx.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.ljx.dao.HandleDao;
import cn.ljx.entity.TBHandle;
import cn.ljx.service.TBHandleService;
@Service
public class TBHandleServiceImpl implements TBHandleService {
	
	@Autowired
	private HandleDao handledao;
	
	//验证登录
	public TBHandle checkLogin(String username, String password) {
    //判断用户是否存在
		TBHandle tbhandle = handledao.getHandleByName(username);
	    if (tbhandle != null && tbhandle.getPassword().equals(password)) {
	        return tbhandle;
	    }
	    	return null;
	}

	public TBHandle getHandleByName(String username) {
		// TODO Auto-generated method stub
		return handledao.getHandleByName(username);
	}


	public int delectHandle(String login_name) {
		// TODO Auto-generated method stub
		return handledao.delectHandle(login_name);
	}

	public int addHandle(TBHandle tbhandle) {
		// TODO Auto-generated method stub
		return handledao.addHandle(tbhandle);
	}

	public TBHandle getHandleById(String id) {
		// TODO Auto-generated method stub
		return handledao.getHandleById(id);
	}

	public int updateHandle(TBHandle tbhandle) {
		// TODO Auto-generated method stub
		return handledao.updateHandle(tbhandle);
	}

	public List<TBHandle> gettbHandleList(String real_name) {
		// TODO Auto-generated method stub
		return handledao.gettbHandleList(real_name);
	}

}
